/**
 * 
 */
package v1c07;

import java.awt.Dimension;
import java.awt.Toolkit;

import javax.swing.JFrame;

/**
 * @author gjunming@gmail.com
 * @version Aug 5, 2009 6:17:42 PM
 */
public class SimpleFrameTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Toolkit toolkit = Toolkit.getDefaultToolkit();
		Dimension screenSize = toolkit.getScreenSize();
		Integer width = screenSize.width;
		Integer height = screenSize.height;

		SimpleFrame myFrame = new SimpleFrame();
		myFrame.setSize(width / 2, height / 2);
		myFrame.setLocationByPlatform(true);
		myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		myFrame.setVisible(true);
		myFrame.setTitle("hello world");
	}

}

class SimpleFrame extends JFrame {

	private static final long serialVersionUID = 1L;
	private static final int DEFAULT_WIDTH = 300;
	private static final int DEFAULT_HEIGHT = 200;

	public SimpleFrame() {
		setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
	}
}
